import request from '@/utils/request'

// 生成练习题
export const generateExercise = (data) => {
  return request({
    url: '/exercise/generate',
    method: 'POST',
    data
  })
}

// 打乱练习题顺序
export const shuffleExercise = (id) => {
  return request({
    url: `/exercise/shuffle/${id}`,
    method: 'POST'
  })
}

// 获取练习历史
export const getExerciseHistory = (params) => {
  return request({
    url: '/exercise/history',
    method: 'GET',
    params
  })
}

// 获取练习详情
export const getExerciseDetail = (id) => {
  return request({
    url: `/exercise/${id}`,
    method: 'GET'
  })
}